package com.truyen.service;

import java.util.List;

import com.truyen.persistence.entity.ChapterTruyenMa;
import com.truyen.persistence.entity.TruyenMa;
import com.truyen.utils.PagingInfo;


public interface ChapterTruyenMaService {
	
	// tao moi
	void save(ChapterTruyenMa entity);

	//tim theo id
	ChapterTruyenMa findById(Long id);

	//lay tat ca
	List<ChapterTruyenMa> getAll();

	//tim chapter theo column name
	ChapterTruyenMa findByProperty(String column, Object value);

	//lay danh sach chapter theo truyen va kw
	List<ChapterTruyenMa> getLstChapterByTruyen(TruyenMa entity,
			String kwSearch, String sort, String sortBy, PagingInfo pInfo);

	//tim chapter theo truyen va alias
	ChapterTruyenMa findAliasvTruyen(TruyenMa entity, String alias);

	//set is delete
	void setIsDelete(Long id);

	//lay tat ca danh sach chapter theo kw , theo noi dung null hoac khong, sap xep va phan trang
	List<ChapterTruyenMa> getLstAllChapterTruyen(String kwSearch, String sort, String sortBy, PagingInfo pInfo);

	//cap nhat lai chapter number
	void updateChapterNumber(Long id, float chapterNumberChange);

	//lay danh sach chapter theo truyen
	List<ChapterTruyenMa> getByTruyen(TruyenMa entity);

	//tim chapter theo truyen va chapter number
	ChapterTruyenMa getChapterByTruyenChapnumber(TruyenMa entity,	float chapterNumber);

	//xoa chapter truyen
	void delete(long id);
	
	//lay danh sach chapter moi
	List<ChapterTruyenMa> getListNewChapter(int maxLimit);

	//cap nhat chapter number cua truyen tranh tu blogtruyen
	void updateLstChapterNumberBlogTruyen();
	
	//cap nhat chapter truyen
	void update(Long id, Float chapterNumber, String content, boolean isDelete,	boolean isHot);

	void update(long id, String newContent);

}
